﻿#include "ConsoleApplication.hpp"

#include <QDebug>
#include <csignal>

ConsoleApplication::ConsoleApplication(int argc, char** argv)
    : QCoreApplication{argc, argv}
{
    signal(SIGTERM, &ConsoleApplication::handleSystemSignal);
    signal(SIGINT, &ConsoleApplication::handleSystemSignal); // 添加 SIGINT (Ctrl+C)
}

void ConsoleApplication::handleSystemSignal(int signal)
{
    qDebug() << "ConsoleApplication::handleSystemSignal: " << signal;
    exit(1);
}
